<%-- 
    Document   : kelola_artikel
    Created on : Jan 12, 2014, 5:51:02 PM
    Author     : brlnt
--%>
<%@page import="model.ArtikelBean"%>
<%@page import="java.util.List"%>
<%@include file="../template/header.jsp"%>
<div class="row">
    <div class="col-lg-6 col-lg-push-1">
        <h3>${title}</h3>
        <hr>
        <div class="form-group">
            <a href="./artikel_baru" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> Tambah Artikel</a>
        </div>
        <table class="table table-striped table-bordered">
            <thead>
            <th>Judul Artikel</th>
            <th>Pengarang</th>
            <th>Tanggal Terbit</th>
            <th>Status</th>
            <th colspan="2" class="text-center">Action</th>
            </thead>
            <tbody>
                <%
                    ArtikelBean dataArtikel;
                    UserBean dataUser;
                    List listdata = (List) request.getAttribute("listArtikel");
                    for (int i = 0; i < listdata.size(); i++) {
                        dataArtikel = (ArtikelBean) listdata.get(i);
                        dataUser = dataArtikel.getUser();
                %>
                <tr>
                    <td><%=dataArtikel.getJudul()%></td>
                    <td><%=dataUser.getFirstName() + " " + dataUser.getLastName()%></td>
                    <td><%=dataArtikel.getTime()%></td>
                    <td><%=dataArtikel.getnStatus()%></td>
                    <td><a href="./edit_artikel?id=<%=dataArtikel.getIdArtikel()%>" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i></a></td>
                    <td>
                        <form action="./hapus_artikel" method="post">
                            <input type="hidden" name="id" value="<%=dataArtikel.getIdArtikel()%>">
                            <button type="submit" class="btn btn-danger">
                                <i class="glyphicon glyphicon-trash"></i>
                            </button>
                        </form>
                    </td>
                </tr>
                <% }%>
            </tbody>
        </table>
    </div>
</div>
<%@include file="../template/footer.jsp"%>

